ifneq ($(KERNELRELEASE),)
# kbuild part of makefile
obj-m := hello-module.o
else
# normal makefile
KDIR ?= /lib/modules/`uname -r`/build
MDIR ?= $(shell pwd)
.PHONY: modules clean distclean
modules:
	$(MAKE) -C $(KDIR) M=$(MDIR) modules
clean:
	rm -rf *.o .*.cmd *.mod* *.order *.symvers
distclean: clean
	rm -rf *.ko
endif
